<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="com.lingzerg.store.*" %>
<%@page import="com.lingzerg.mainacct.DAO.*" %>
<%@page import="com.lingzerg.mainacct.DAO.impl.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>login</title>
</head>
<body>
<%
	UserDao us = new UserDaoImpl();
	if("POST".equals(request.getMethod())){
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		System.out.println(password + username);
		//if(username !=null && username.trim().length()>=3 && username.trim().length()<21 && password!=null){
			//username = username.trim();
			//password = password.trim();
			if(us.checkLogin(username,password)){
				out.print("输入正确,可以登录");
			} else {
				out.print("用户名或密码错误");
			}
			
		//}
	}
%>
<form method="POST">
	<table>
		<caption>登录</caption>
		<tr>
			<th>用户名 : </th>
			<td><input type="text" name="username" size="20" maxlength="20"/>3-20字符</td>
		</tr>
		<tr>
			<th>密码 : </th>
			<td><input type="password" name="password" size="20" maxlength="32"/></td>
		</tr>
		<tr>
			<td colspan="2"><input type="submit" value="登录" /></td>
		</tr>
	</table>
</form>
</body>
</html>